{include file="header.html"}
 
 <ul class="nav nav-tabs">
 	<li class="active"><a href="{$appadmin}?m=koudai_product">产品管理</a></li>
   
 </ul>
<div class="main-body">
 
 <div class="plist">
  {foreach item=c from=$data}
  <div class="item">
   
    
    	<div class="g-sd1">
        	<img src="{$c.imgurl|images_site}.100x100.jpg">
        </div>
        <div class="g-mn1">
        	<div class="g-mn1c">
            	 <div class="title">{$c.title}</div>
            	<div class="row-price">
               	 <span>价格￥<span id="price{$c.id}">{$c.price}</span> <span>
                 <span>{if $c.lower_price >0}促销价：￥{$c.lower_price}元{/if}</span>
                 <span>官方价：{$c.p_price}</span>
                 <span>库存：{$c.total_num}</span>
                 <span>销量：{$c.buy_num}</span>
                </div>
                <div class="tools"> <a href="javascript:;" url="{$appadmin}?m=koudai_product" did="{$c.id}" class="chprice">修改售价</a> </div>

            </div>
        </div>
   
    
    
  </div>
  {/foreach}
  </div>
  {if $pagelist}
  <div>{$pagelist}</div>
    {/if}
 

</div>
 

{include file='footer.html'}
<script>
 
$(function(){
	$(document).on("click",".chprice",function(data){
		var html='<div class="pd-5"><input type="text" style="width:60px" id="kd_price"> <button class="btn" id="kd_price_submit" did="'+$(this).attr("did")+'">修改</button><div>';
		showbox("修改价格",html,200,100); 
	});
	
	$(document).on("click","#kd_price_submit",function(data){
		var obj=$(this);
		$.get("{$appadmin}?m=koudai_product&a=chprice&ajax=1",{
				id:$(this).attr("did"),
				price:$("#kd_price").val()
			},function(data){
				if(data.error){
					skyToast(data.message);
				}else{
					$("#price"+obj.attr("did")).html($("#kd_price").val());
				}
		},"json");
	});
	 
});
</script>
</div>
</body>
</html>